package dao;

import org.hibernate.Criteria;
import org.hibernate.classic.Session;
import org.hibernate.criterion.Order;

import to.Configuracao;
import util.HibernateUtil;

public class ConfiguracaoDAO {

	public Configuracao buscaConfiguracao() {

		Configuracao lista = new Configuracao();
		Session session = null;

		try {

			session = HibernateUtil.getSessionFactory().openSession();
			Criteria criteria = session.createCriteria(Configuracao.class, "c");
			criteria.addOrder(Order.asc("c.id"));
			lista = (Configuracao) criteria.uniqueResult();

		} catch (Exception e) {
			e.printStackTrace();
		}
		return lista;
	}

}
